package main

import (
	"fmt"
)

func main() {

	s := Student{sub: 1, sid: 2, name: "我是小尾巴", Person: Person{name: "小王吧", age: 26}}

	fmt.Println(s)

	s.setName("aaaaaaaaaaa")

	s.Person.setName("aaaaaaaaaaa")

	fmt.Fprintln(s)
	}

type Person struct {
	name string

	age int
}

type Student struct {
	//匿名字段
	Person

	// 学号
	sid int

	// subject
	sub int

	name string
}

func (n *Person) getName() (name string) {

	return n.name
}
func (n *Person) setName(name string) () {

	fmt.Printf(" n ty[e is %T \n" , n)

	n.name = name
}
func (n *Student) setName(name string) () {

	fmt.Printf(" n ty[e is %T \n" , n)

	n.name = name
}


